<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * Appcan控制器
 */
class Appcan extends AdminBase
{
    
    /**
     * Appcan列表
     */
    public function AppcanList()
    {
        
        $where = $this->logicAppcan->getWhere($this->param);
        
        $this->assign('list', $this->logicAppcan->getAppcanList($where, 'a.*', 'a.create_time desc'));
        $this->assign('param',$this->param);
        return $this->fetch('appcan_list');
    }
    
    /**
     * Appcan添加
     */
    public function AppcanAdd()
    {
        
        $this->AppcanCommon();

        return $this->fetch('appcan_edit');
    }
    
    /**
     * Appcan编辑
     */
    public function AppcanEdit()
    {
        
        $this->AppcanCommon();

        $info = $this->logicAppcan->getAppcanInfo(['a.id' => $this->param['id']], 'a.*');

        $this->assign('info', $info);
        return $this->fetch('appcan_edit');
    }
    
    /**
     * Appcan添加与编辑通用方法
     */
    public function AppcanCommon()
    {
        
        IS_POST && $this->jump($this->logicAppcan->AppcanEdit($_POST));
        

    }
    

   /**
     * 数据状态设置
     */
    public function excel()
    {

        IS_POST && $this->jump($this->logicAppcan->excel( $this->param));
        return $this->fetch('excel');
    }
    

    /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('ApplicationBanker', $this->param));
    }




    /**
     * 数据状态设置
     */
    public function update_info()
    {

        $this->jump($this->logicAppcan->update_info( $this->param));
    }

    /**
     * 财务明细列表
     */
    public function AppcanAccountList()
    {


        $this->assign('list', $this->logicAppcan->getAccountList($this->param, 'a.*,b.username,b.is_shop,b.is_king,b.mobile,b.is_company,g.name,g.return_point,g.mult', 'a.create_time desc'));
        $this->assign('param',$this->param);
        return $this->fetch('appcan_account_list');
    }





}
